<include file="Public:header" />
<div class="pad-lr-10">    
    <form id="myform" name="myform" action="{:u('goods/delete')}" method="post" onsubmit="return check();">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width="2%"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
                <th width="40%">{$Think.lang.goods_name}</th>
                <th>{$Think.lang.goods_sn}</th>
                <th>{$Think.lang.shop_price}</th>
                <th>{$Think.lang.goods_stock}</th>
                <th>{$Think.lang.operations_manage}</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="goods_list" id="val" >
        <tr>
            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>
            <td>{$val.name}</td>
            <td>{$val.goods_sn}</td>
            <td align="right">{$val.sprice}</td>
            <td>{$val.stock}</td>
            <td align="center"><a href="{:u('goods/edit', array('id'=>$val['id']))}">{$Think.lang.edit}</a> | <a href="{:u('goods/delete', array('id'=>$val['id']))}">{$Think.lang.delete}</a></td>
        </tr>
        </volist>
    	</tbody>
    </table>
    
    <div class="btn">
    <label for="check_box">{$Think.lang.select_all}/{$Think.lang.cancel}</label> 
    <input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')"/>
    <div id="pages"></div>
    </div>
    
    
    </div>
    </form>
</div>
<script language="javascript">
function edit(good_id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'{$lang.edit}--'+name,id:'edit',iframe:'?m=score&a=edit_good&good_id='+good_id,width:'550',height:'400'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}

function check(){
	if($("#myform").attr('action') != '?m=score&a=sort_order') {
		var ids='';
		$("input[name='good_id[]']:checked").each(function(i, n){
			ids += $(n).val() + ',';
		});
		
		if(ids=='') {
			window.top.art.dialog({content:'{$lang.plsease_select}{$lang.article_cate}',lock:true,width:'200',height:'50',time:1.5},function(){});
			return false;
		}
	}
	return true;
}
</script>
</body>
</html>